import { lazy } from "react";
import { FriendsO, HomeO,CartO ,TodoListO } from '@react-vant/icons';
export let mainRouter =[
    {
        path:'/home/shou',
        element:lazy(()=> import('../view/Home/Shou')),
        title:"首页",
        icon:<HomeO />
    },
    {
        path:'/home/classify',
        element:lazy(()=> import('../view/Home/Classify')),
        title:"分类",
        icon:<TodoListO />
    },
    {
        path:'/home/cart',
        element:lazy(()=> import('../view/Home/Cart')),
        title:"购物车",
        icon:<CartO />
    },
    {
        path:'/home/my',
        element:lazy(()=> import('../view/Home/My')),
        title:"我的",
        icon:<FriendsO />
    }
]

const routes =[
    {
        path:'*',
        element:lazy(()=> import('../view/Eroor') )
    },
    {
        path:'/home',
        element:lazy(()=> import('../view/Home') ),
        children:mainRouter
    },
    {
        path:'/detail/:id',
        element:lazy(()=>import('../view/Detail'))
    },
    {
        path:'/login',
        element:lazy(()=>import('../view/Login'))
    },
    {
        from:'/',
        to:'/home/shou'
    }
]

export default routes;